// 创建 count 的核心 reducer
export default function countReducer(preState = 0, action) {
  console.log('preState-->', preState)
  console.log('action-->', action)
  const { type, data } = action
  switch (type) {
    case 'increment':
      return preState + data
    case 'decrement':
      return preState - data
    default:
      return preState
  }
}
